<template>
  <div class="device-tags-component">
    <alarm-row class="device-tags-row" label="摄像机标签：" is-single>
      <el-scrollbar class="scrollbar">
        <div class="device-tags-content">
          <div
            class="device-tag"
            v-for="(tag, index) in deviceLabel"
            :key="tag + index"
          >
            {{ tag }}
          </div>
        </div>
      </el-scrollbar>
    </alarm-row>
  </div>
</template>
<script>
import AlarmRow from "./AlarmRow.vue";
export default {
  name: "DeviceTags",
  components: {
    AlarmRow,
  },
  props: {
    deviceLabel: {
      type: Array,
      default: () => [],
    },
  },
};
</script>

<style lang="scss" scoped>
.device-tags-component {
  width: 100%;
  min-height: 32px;
  line-height: 32px;
  margin-bottom: 6px;
  .scrollbar {
    min-height: 32px;
    max-height: 96px;
    ::v-deep .el-scrollbar__view {
      max-height: 96px;
    }
    ::v-deep .el-scrollbar__wrap {
      margin-bottom: 0px !important;
    }
  }
  ::v-deep .device-tags-row {
    .value {
      overflow: unset !important;
    }
    .label {
      height: 32px !important;
      min-width: 154px !important;
    }
    &.row {
      align-items: unset !important;
    }
    .device-tags-content {
      flex: 1;
      min-width: 32px;
      line-height: 32px;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      .device-tag {
        min-height: 24px;
        padding: 3px 12px;
        line-height: 18px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: 12px;
        color: #ff6a6c;
        background: rgba(255, 106, 108, 0.1);
        border-radius: 4px;
        border: 1px solid rgba(255, 106, 108, 0.5);
        margin-top: 6px;
        margin-right: 6px;
        white-space: normal;
      }
    }
  }
}
</style>
